﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ListClients.aspx.vb" Inherits="TIS.ListClients" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:LinkButton ID="btnNewClient" runat="server" PostBackUrl="~/CreateClient.aspx?mode=new&key=">Add New Client</asp:LinkButton>
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="CompId,ClientId" 
        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="CompId" HeaderText="CompId" ReadOnly="True" 
                SortExpression="CompId" Visible="False" />
            <asp:BoundField DataField="ClientId" HeaderText="ClientId" ReadOnly="True" 
                SortExpression="ClientId" Visible="False" />
            <asp:BoundField DataField="ClientName" HeaderText="Client Name" 
                SortExpression="ClientName">
            <ItemStyle Width="200px" />
            </asp:BoundField>
            <asp:BoundField DataField="NIC" HeaderText="NIC" SortExpression="NIC">
            <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="EmailId" HeaderText="Email" SortExpression="EmailId">
            <ItemStyle Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="ContactNo" HeaderText="Contact No" 
                SortExpression="ContactNo">
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="PassportNo" HeaderText="Passport No" 
                SortExpression="PassportNo">
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="ExpiryDate" DataFormatString="{0:dd/MM/yyyy}" 
                HeaderText="Expiry Date" SortExpression="ExpiryDate">
            <ItemStyle HorizontalAlign="Right" Width="100px" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="IsActive" HeaderText="Active" ReadOnly="True" 
                SortExpression="IsActive">
            <ItemStyle HorizontalAlign="Center" Width="100px" />
            </asp:CheckBoxField>
            <asp:ButtonField CommandName="Edit" Text="Edit" />
            <asp:ButtonField CommandName="Delete" Text="Delete" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DBConnStr %>" 
        ProviderName="<%$ ConnectionStrings:DBConnStr.ProviderName %>" 
        SelectCommand="SELECT [CompId], [ClientId], [ClientName], [NIC], [IsActive], [EmailId], [ContactNo], [PassportNo], [ExpiryDate] FROM [Clients]">
    </asp:SqlDataSource>
    <br />
</asp:Content>
